<template>
  <el-config-provider :size="globalComSize" :locale="zhCn">
    <router-view></router-view>
    <!-- <WatchLogin /> -->
  </el-config-provider>
</template>

<script lang="ts" setup>
  import { computed, onMounted } from 'vue'
  import { useSettingStore } from '@/store/modules/setting'
  // 配置element中文
  import zhCn from 'element-plus/es/locale/lang/zh-cn'
  import timeoutReLogin from './utils/timeoutReLogin'

  const SettingStore = useSettingStore()
  // 配置全局组件大小
  const globalComSize = computed((): string => SettingStore.themeConfig.globalComSize)

  onMounted(() => {
    timeoutReLogin()

    window.addEventListener('vite:preloadError', () => {
      window.location.reload()
    })
  })
</script>

<style lang="scss">
  #app {
    position: relative;
    width: 100%;
    height: 100%;
  }
  .el-pager li:focus {
    border: none;
  }
  .el-dropdown:focus {
    border: none;
  }
  .svg-icon:focus {
    border: none;
  }
</style>
